$(function() {
	$("#header").load('header.html', function() {
		loadHeader()
	});
$("#footer").load('footer.html', function() {});
	function getUrlParam(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		var r = window.location.search.substr(1).match(reg); //匹配目标参数
		if(r != null) return unescape(r[2]);
		return null; //返回参数值
	}
	//接收URL中的参数
	var id = getUrlParam('id');
	console.log(id)
	$.ajax({
		type: "post",
		url: host + '/CMSAPI/detail',
		dataType: 'JSON',
		data: {
			id: id,
			cid: cid
		},
		success: function(res) {
			var show = res.data
			if(res.state) {
				var newsHtml = ''
				newsHtml = `
								<div class="show-intro-title">${show.title}</div>
								<ul class="show-intro-data">
									<li>发布时间: ${show.publishDate}</li>
									<li>主办单位: ${show.publisher}</li>
								</ul>
								<div class="show-intro-intro"></div>
								<div class="show-intro-content">${show.content}</div>
								`
			};
			$('.show-intro').append(newsHtml)
		}
	})
})